import React from "react";
import UcSkeleton from "./uc-skeleton";


export default class UcSkeletonTest extends React.Component {
    state = {
        loading: true, //加载数据
        data: [] //数据加载完放的位置
    };

    componentDidMount() {
        // 模拟读数据
        setTimeout(() => {
            this.setState({ data: '加载数据', loading: false })
        }, 1000)
    }

    render() {
        return (
            <div>
                <h3>测试鱼骨架</h3>
                <UcSkeleton loading={this.state.loading} avatar paragraph={{ rows: this.state.data, width: 200 }} >
                    <div>内容</div>
                </UcSkeleton>

                <UcSkeleton loading={this.state.loading}
                    avatar
                    paragraph={{ rows: this.state.data, width: 200 }}
                >
                    <div>内容2</div>
                </UcSkeleton>
            </div>
        )
    }
}